import java.util.Scanner;

public class YearChar {
    static int count = 0;
    static String str;
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        String[] arr = new String[] {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
                "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
        arrangement(arr, "", 0);
        System.out.println(str);
        scan.close();
    }

    public static void arrangement(String[] arr, String ret, int index) {
        if (count == 1317) {
            return;
        }
        if (ret.length() == 3) {
            System.out.println(ret);
            count++;
            if (count == 1317) {
                str = ret;
            }
            return;
        }
        for (int i = 0; i < arr.length; i++) {
            String str = arr[i];
            arrangement(arr, ret + str, index + 1);
        }
    }
}
